package com.xiejun.aop;

import com.spring.bean.BeanPostProcessor;
import com.spring.annotation.Component;

@Component
public class XiejunBeanPostProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) {
        System.out.println("初始化前");
        // 这里不再需要手动创建代理，由框架统一处理
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) {
        System.out.println("初始化后");
        // 这里不再需要手动创建代理，由框架统一处理
        return bean;
    }
}
